<template>
<div class="body">
  <!-- 明星会员 -->
  <div class="star-member">
    <!-- top -->
    <div class="index-title">-  热点关注  -</div>
    <!-- sliding container -->
    <div class="swiper-container" id="star_member" style="overflow-x: scroll;">
      <div class="swiper-wrapper" style="-webkit-overflow-scrolling: touch;"> 
        <!-- member -->
        <div class="swiper-slide" style="width: 75px;" v-for="(item,i) of list" :key="i" >
          <div class="member_avatar"><img :src="item.memberPhoto"></div> 
          <div class="author-badge" :style="{background:item.chenghao=='国家级名厨'?'url(img/index/author_v.png) no-repeat center center':'url(img/index/author_u.png) no-repeat center center','background-size':'auto 100%'}"></div> 
          <div class="member_name">{{item.memberName}}</div> 
          <div class="chenghao" :style="{color:item.chenghao=='国家级名厨'?'#fe7c23':'#333'}">{{item.chenghao}}</div> 
        </div>
      </div>    
    </div>
    <!--推荐内容-->
    <div class="recommend-block">
      <div class="recommend-block-item">
        <a>
          <img src="img/index/xihongshi.jpg">
          <div class="desc">
            <h6>今日新品</h6>
            <div class="desc-name">西红柿炖牛腩</div>
          </div>
        </a>
      </div>
      <div class="recommend-block-item">
        <a>
          <img src="img/index/yaoguo.jpg">
          <div class="desc">
            <h6>当季流行</h6>
            <div class="desc-name">腰果鸡丁</div>
          </div>
        </a>
      </div>
      <div class="clearfix"></div>
    </div>
  </div>
</div>
</template>
<script>
// import {getIndex} from "../assets/js/apis/index.js"

export default {
  data() {
    return {
      list:[
        {
          "memberPhoto":"img/index/star2.jpg",
          "memberName":"朱长江",
          "chenghao":"国家级名厨",
        },
        {
          "memberPhoto":"img/index/star4.jpg",
          "memberName":"刘强",
          "chenghao":"国家级名厨",
        },
        {
          "memberPhoto":"img/index/star9.jpg",
          "memberName":"高炳义",
          "chenghao":"国家级名厨",
        },
        {
          "memberPhoto":"img/index/star10.jpg",
          "memberName":"朱长江",
          "chenghao":"国家级名厨",
        },
        {
          "memberPhoto":"img/index/star1.jpg",
          "memberName":"承多猫",
          "chenghao":"知名博主",
        },
        {
          "memberPhoto":"img/index/star3.jpg",
          "memberName":"月澜姐",
          "chenghao":"知名博主",
        },
        {
          "memberPhoto":"img/index/star5.jpg",
          "memberName":"菜菜美食",
          "chenghao":"知名博主",
        },
        {
          "memberPhoto":"img/index/star6.jpg",
          "memberName":"罐头视频",
          "chenghao":"知名博主",
        },
        {
          "memberPhoto":"img/index/star7.jpg",
          "memberName":"壹食三刻",
          "chenghao":"知名博主",
        },
        {
          "memberPhoto":"img/index/star8.jpg",
          "memberName":"迷迭香美食",
          "chenghao":"知名博主",
        }
      ]
    }
  },
  /*
  methods:{
    getdata(){
      this.axios.get("/bozhulist").then((res)=>{
        this.list=res.data;
      })
    }
  }
  */
}
</script>
<style scoped>
.clearfix::after {
    display: block;
    clear: both;
    content: "";
}
/* 隐藏导航条 */
#star_member::-webkit-scrollbar { display:none }
/* 明星成员 */
.swiper-container {
    margin-left: auto;
    margin-right: auto;
    position: relative;
    overflow: hidden;
    z-index: 1;
    margin-bottom: 3vw;
}
.swiper-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 1;
    display: -webkit-box;
    display: -moz-box;
    display: -ms-flexbox;
    display: -webkit-flex;
    display: flex;
    -webkit-transition-property: -webkit-transform;
    -moz-transition-property: -moz-transform;
    -o-transition-property: -o-transform;
    -ms-transition-property: -ms-transform;
    transition-property: transform;
    -webkit-box-sizing: content-box;
    -moz-box-sizing: content-box;
    box-sizing: content-box;
}
.star-member {
    padding: 3vw 0;
    background-color: #FFF;
    margin-bottom: 3vw;
}
.swiper-slide {
    -webkit-flex-shrink: 0;
    -ms-flex: 0 0 auto;
    flex-shrink: 0;
    width: 100%;
    height: 100%;
    position: relative;
    text-align: center;
}
.index-title {
    font-size: 1.1rem;
    font-weight: bold;
    text-align: center;
    padding-bottom: 2vw;
    margin-bottom: 2vw;
    border-bottom: #eee 1px solid;
}
.member_name {
    font-size: .25rem;
    color: #666;
    /* width: 100%; */
    padding: 0 2vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chenghao {
    font-size: .25rem;
    color: #fe7c23;
}
#star_member .member_avatar {
    width: 50px;
    height: 50px;
    margin: auto;
    margin-bottom: 1.5vw;
    border-radius: 50%;
    border: #ccc 1px solid;
    overflow: hidden;
    position: relative;
}
.member_avatar img {
    width: 100%;
    margin: auto;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}
.author-badge {
    width: 10vw;
    height: 10vw;
    position: absolute;
    margin: auto;
    right: 0;
    bottom: 12vw;
    z-index: 10;
}
/* 推荐内容 */
 .recommend-block {
    padding: 3vw;
    background-color: #FFF;
    margin-bottom: 3vw;
}
.recommend-block-item {
    width: 50%;
    height: 50vw;
    float: left;
    position:relative;
}
.recommend-block .recommend-block-item a {
    height: 100%;
    /* margin-left: 2vw; */
    margin-right: 1.5vw;
    display: block;
    overflow: hidden;
    position: relative;
}
.recommend-block .recommend-block-item img {
    width: 100%;
}
.desc {
    color: #FFF;
    width: 100%;
    background-color: rgba(0,0,0,.2);
    position: absolute;
    bottom:0;
}
.recommend-block .recommend-block-item .desc h6 {
    color: #fff;
    font-size: 1.2rem;
    font-weight: bold;
    line-height: normal;
    padding-top: 1vw;
    padding: 0 1.5vw;
}
.desc-name {
    font-size: .99rem;
    padding: 1vw 1.5vw;
}
</style>
